<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src/components/APP/Main/Login/Page.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="..\..\..\..\..\prettify.css" />
    <link rel="stylesheet" href="..\..\..\..\..\base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(..\..\..\..\..\sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="..\..\..\..\..\index.html">All files</a> / <a href="index.html">src/components/APP/Main/Login</a> Page.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/20</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/14</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/6</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/20</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;template&gt;
  &lt;div o-Container o-Container-App&gt;
    &lt;div id="tb_Username"&gt;
      &lt;van-field v-model="octopus.passport.name" clearable placeholder="请输入用户名" AUTOCOMPLETE="off"/&gt;
    &lt;/div&gt;
    &lt;div id="tb_Password"&gt;
      &lt;van-field v-model="octopus.passport.password" type="password" clearable placeholder="请输入密码"/&gt;
    &lt;/div&gt;
    &lt;div id="tb_Button" @click="login"&gt;登陆&lt;/div&gt;
  &lt;/div&gt;
&lt;/template&gt;
&nbsp;
&lt;script&gt;
  export default {
    name: "app_en_database_item", /* 这个name暂时不知道用啥用，根据官方文档说的是方便排错的 */
<span class="fstat-no" title="function not covered" >    data() {</span>
<span class="cstat-no" title="statement not covered" >      return {</span>
        octopus: this.$parent.octopus,
      }
    },
<span class="fstat-no" title="function not covered" >    activated: function () {</span>
      // 如果不是移动端，则跳转到web
<span class="cstat-no" title="statement not covered" >      if (!this.octopus.tools.isMobile()) {</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.router.jump("/admin/login");</span>
      }
&nbsp;
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Login.vue执行了activated事件。");</span>
    },
    methods: {
      // 登录前置审核
<span class="fstat-no" title="function not covered" >      login: function () {</span>
        // 提交的时候判断是否是已经加密，如果没有，则提交登录的时候对数据进行加密。
<span class="cstat-no" title="statement not covered" >        if (!this.octopus.passport.encryption) {</span>
          // 更新时间戳（毫秒）
<span class="cstat-no" title="statement not covered" >          this.octopus.passport.timespan = (new Date()).valueOf();</span>
<span class="cstat-no" title="statement not covered" >          this.octopus.passport.password = this.octopus.tools.md5(this.octopus.passport.name</span>
            + "marco" + this.octopus.passport.timespan + "july" + this.octopus.passport.password);
        }
&nbsp;
        // 触发登录函数
<span class="cstat-no" title="statement not covered" >        this.auto();</span>
      },
<span class="fstat-no" title="function not covered" >      auto: function () {</span>
<span class="cstat-no" title="statement not covered" >        let o = this;</span>
        // 获取护照数据，不管成功与否，全部设置为true。
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >        this.octopus.request.security.passport.get(function (passport_data) {</span></span>
<span class="cstat-no" title="statement not covered" >          o.octopus.passport.encryption = true;</span>
<span class="cstat-no" title="statement not covered" >          if (!o.octopus.tools.IsNullOrEmpty(passport_data) &amp;&amp; passport_data.status.code == 200) {</span>
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >            o.octopus.request.security.token.get(function (token_data) {</span></span>
<span class="cstat-no" title="statement not covered" >              if (!o.octopus.tools.IsNullOrEmpty(token_data) &amp;&amp; token_data.status.code == 200) {</span>
                // 登陆成功，告知移动端传递函数
<span class="cstat-no" title="statement not covered" >                if (window.setLogin) {</span>
<span class="cstat-no" title="statement not covered" >                  window.setLogin(false);</span>
                }
                // 调试时打印获取到权限数据。
<span class="cstat-no" title="statement not covered" >                o.octopus.tips.debug("Login页面Auto更新护照：" + JSON.stringify(passport_data));</span>
                // 执行跳转系统内页
<span class="cstat-no" title="statement not covered" >                o.octopus.router.jump("/APP/Main/Home/Page");</span>
              } else {
<span class="cstat-no" title="statement not covered" >                o.octopus.tips.error(token_data);</span>
              }
            });
          } else {
<span class="cstat-no" title="statement not covered" >            o.octopus.tips.error(passport_data);</span>
          }
        });
      },
    },
    props: ["oData"]
  }
&lt;/script&gt;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Jan 20 2020 17:54:15 GMT+0800 (GMT+08:00)
</div>
</div>
<script src="..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="..\..\..\..\..\sorter.js"></script>
</body>
</html>
